const initState = 0
// reducer 接受两个参数
export const countReducer = (preState = initState, action) => {
    const {type, data} = action
    switch(type){
        case 'increment':
            return preState + data * 1
        case 'decrement':
            return preState - data *1
        default:
            return preState
    }
}